import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_jd/pages/tabbar/cart/controller.dart';
import 'package:flutter_jd/ui/widgets/kit.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

// checkbox
class CartCheckbox extends GetWidget<CartController> {
  final bool isSelected;
  CartCheckbox(this.isSelected);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 20.r,
      height: 20.r,
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(30.r),
        border: Border.all(
          color: isSelected ? Colors.red : Color(0xFFDDDDDD),
          width: 1.5.sp,
        ),
      ),
      alignment: Alignment.center,
      child: Container(
        alignment: Alignment.center,
        decoration: BoxDecoration(
          color: isSelected ? Color(0xFFF93A19) : Colors.white,
          borderRadius: BorderRadius.circular(30.r),
        ),
        child: Kit.iconFont(
          0xe736,
          isSelected ? Colors.white : Colors.transparent,
          13.sp,
        ),
      ),
    );
  }
}
